<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="../common.jsp" %>

   	<div class="user">
       	<img src="${_ctx}/resource/img/avatar.png" width="44" height="44" class="hoverimg" alt="Avatar" />
           <p>Logged in as:</p>
           <p class="username">Administrator</p>
           <p class="userbtn"><a href="#" title="">Profile</a></p>
           <p class="userbtn"><a href="#" title="">Log out</a></p>
       </div>
       <div class="notifications">
       	<p class="notifycount"><a href="" title="" class="notifypop">10</a></p>
           <p><a href="" title="" class="notifypop"><fmt:message key="view.notifications.new" /></a></p>
           <p class="smltxt"><fmt:message key="view.notifications.open" /></p>
       </div>
       
       <input type="hidden" id="curr_menu_url" />
       <ul id="nav">
       	<c:forEach items="${menus}" var="menu" varStatus="status">
       	<li>
		<c:choose>
			<c:when test="${menu.subMenus != null}">
				<a class="collapsed heading">${menu.name}</a>
              	<ul class="navigation">
				<c:forEach items="${menu.subMenus}" var="submenu" varStatus="status">
					<li id="${submenu.id}"><a href="javascript:leftside.menuClick('${submenu.id}', '${_ctx}${submenu.url}')" title="${submenu.title}">${submenu.name}</a></li>
				</c:forEach>
              	</ul>
			</c:when>
			<c:otherwise>
				<ul class="navigation">
					<li id="${menu.id}"><a href="javascript:leftside.menuClick('${menu.id}', '${_ctx}${menu.url}')"  title="${menu.title}">${menu.name}</a></li>
                </ul>
			</c:otherwise>
		</c:choose>
		</li>      		
       	</c:forEach>
       </ul>

	<script type="text/javascript">
		$(document).ready(function() {
			$("#nav > li > a.collapsed + ul").slideToggle("medium");
			$("#nav > li > a").click(function() {
				$(this).toggleClass('expanded').toggleClass('collapsed').parent().find('> ul').slideToggle('medium');
			});
			
			
			$("a.notifypop").bind("click", function() {
				leftside.popup();
				return false;
			});
		});
		

	</script>
